package com.nimt.hqgl_idea.service;


import com.nimt.hqgl_idea.util.ResponseBody;
import com.nimt.hqgl_idea.entity.ServiceType;
import com.nimt.hqgl_idea.mapper.ServiceTypeMapper;
import com.nimt.hqgl_idea.util.ErrorEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServiceTypeServiceImpl implements ServiceTypeService {
    @Autowired
    ServiceTypeMapper serviceTypeMapper;
    @Override
    public ResponseBody query() {
        ResponseBody responseBody = null;
        List<ServiceType> serviceTypes = serviceTypeMapper.selectAll();
        if(serviceTypes==null||serviceTypes.size()==0){
            responseBody = new ResponseBody(ErrorEnum.No_More_Data);
        }else {
            responseBody = new ResponseBody(serviceTypes);
        }
        return responseBody;
    }
}
